# coding: utf-8

import os

path = r"F:\Developer\Python\Python-Projects\Independent-Projects\PyTorch-DeepSort\Video\三人篮球女子中国日本"

file_names = os.listdir(path)
# print(file_names[0])
# replace_name = file_names[0].replace("_提交新冠疫苗接种信息截图", "")
# print(os.path.join(path,file_names[0]))
# print(os.path.join(path,replace_name))

for name in file_names:
    name_split = name.split('.')
    replace_name = f"{name_split[0].rjust(3, '0')}.{name_split[1]}"
    print(f"{name} -> {replace_name}")
    os.renames(os.path.join(path, name), os.path.join(path, replace_name))
